package cn.hls.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * @fileName: ShipOrderSite.java
 * @package: cn.hls.entity 　*@Description: 电子运单站点实体类 
 * @author: yinghui.zhang
 * @email: uuhui@163.com
 * @date: 2016年6月30日
 */
@Entity
@Table(name = "t_shiporder_site")
@DynamicInsert
@DynamicUpdate
public class ShipOrderSite extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5423218476313174592L;
	private Long shipOrderId;
	private Site site;// 站点信息
	private Integer siteType;// 站点类型

	public ShipOrderSite() {

	}

	public ShipOrderSite(Long shipOrderId) {
		this.shipOrderId = shipOrderId;
	}
	
	public ShipOrderSite(Long shiprderId,Integer siteType){
		this.shipOrderId=shiprderId;
		this.siteType=siteType;
	}

	@Column(name = "shiporder_id")
	public Long getShipOrderId() {
		return shipOrderId;
	}

	public void setShipOrderId(Long shipOrderId) {
		this.shipOrderId = shipOrderId;
	}

	@ManyToOne(optional = true)
	@JoinColumn(name = "site_id")
	@NotFound(action = NotFoundAction.IGNORE)
	public Site getSite() {
		return site;
	}

	public void setSite(Site site) {
		this.site = site;
	}

	@Transient
	public Integer getSiteType() {
		return siteType;
	}

	public void setSiteType(Integer siteType) {
		this.siteType = siteType;
	}

}
